﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTTB.Assembler;
using DTTB.DAO;
using DTTB.Domain;
using DTTB.DTO;
    
namespace DTTB.SERVICE
{
    public class RolesInPathsService
    {
        RolesInPathsAssembler RolesInPathsAssembler = new RolesInPathsAssembler();
        RolesInPathsDao RolesInPathsDao = new RolesInPathsDao();


        public IList<RolesInPathsDto> GetRolesInPathsByRolesId(string roleId)
        {
            IList<RolesInPaths> rolesInPathsList = RolesInPathsDao.GetRolesInPathsByRolesId(roleId);
            IList<RolesInPathsDto> rolesInPathsDtoList = RolesInPathsAssembler.ConvertToDataTransferObjectList(rolesInPathsList);

            return rolesInPathsDtoList;
        }

        public IList<RolesInPathsDto> GetAllRolesInPathsByPathId(string pathId)
        {
            IList<RolesInPaths> rolesInPathsList = RolesInPathsDao.GetAllRolesInPathsByPathId(pathId);
            IList<RolesInPathsDto> rolesInPathsDtoList = RolesInPathsAssembler.ConvertToDataTransferObjectList(rolesInPathsList);

            return rolesInPathsDtoList;
        }

        public int CountRolesInPathsByRoleId(string roleId)
        {
            return RolesInPathsDao.CountRolesInPathsByRoleId(roleId);

           
        }

        public bool AddNewRolesInPaths(RolesInPathsDto rolesInPathsDto)
        {
            return RolesInPathsDao.AddNewRolesInPaths(RolesInPathsAssembler.ConvertToBusinessObject(rolesInPathsDto));
        }

        public bool DeleteRolesInPathsByRolesId(string rolesId)
        {
            return RolesInPathsDao.DeleteRolesInPathsByRolesId(rolesId);
        }
    }
}
